package org.ushio.nchu_22201402.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.ushio.common_module.entity.CustomerService;
import org.ushio.common_module.entity.CustomerServiceRecord;
import org.ushio.nchu_22201402.Foen.Admin_CSFoen;
import org.ushio.nchu_22201402.service.Admin_CSService;

import java.util.List;

@RestController
@CrossOrigin
@RequestMapping("/AdminCs")
public class Admin_CSController {
    @Autowired
    private Admin_CSFoen adminCsFoen;

    @Autowired
    private Admin_CSService adminCSService;

    @RequestMapping("/getCSRecord")
    public List<CustomerServiceRecord> getServiceOnlineRecordToAdmin(){
        return  adminCsFoen.getServiceOnlineRecordToAdmin();
    };

    @GetMapping(value = "/customerWhoWork")
    public List<CustomerServiceRecord> customerWhoWork(@RequestParam int customerServiceId){
        System.out.println(customerServiceId);
        System.out.println(adminCSService.customerWhoWork(customerServiceId));
        return adminCSService.customerWhoWork(customerServiceId);
    }

    @RequestMapping(value = "/ListAllCS")
    public List<CustomerService> ListAllCS(){

        return adminCsFoen.getCustomerServiceInfo();
    }

}
